package main.chapter3

enum class LogLevel(val id: Int) {
    VERBOSE(0), DEBUG(1), INFO(2), WARM(3), ERROR(4), ASSET(5);

    fun getTag(): String {
        return "id=$id,name=$name"
    }

    override fun toString(): String {
        return "$name,$ordinal"
    }
}

fun main(args: Array<String>) {
    println(LogLevel.VERBOSE.getTag())
    //拿到位置
    println(LogLevel.ASSET.ordinal)

    LogLevel.values().map(::println)

    println(LogLevel.valueOf("ERROR"))
}

